package exception;

import java.io.FileOutputStream;
import java.io.IOException;

public class AutoCloseableDemo {
    public static void main(String[] args) throws Exception {
        try (FileOutputStream fos = new FileOutputStream("fos.dat")){
            fos.write( 2);
        } catch (IOException e) {
            e.printStackTrace();
        }
        String lin = "da";
        System.out.println(lin);

    }
}
